# == Class: lustre
#
# Full description of class lustre here.
#
# === Parameters
#
# Document parameters here.
#
# [*sample_parameter*]
#   Explanation of what this parameter affects and what it defaults to.
#   e.g. "Specify one or more upstream ntp servers as an array."
#
# === Variables
#
# Here you should define a list of variables that this module would require.
#
# [*sample_variable*]
#   Explanation of how this variable affects the funtion of this class and if
#   it has a default. e.g. "The parameter enc_ntp_servers must be set by the
#   External Node Classifier as a comma separated list of hostnames." (Note,
#   global variables should be avoided in favor of class parameters as
#   of Puppet 2.6.)
#
# === Examples
#
#  class { lustre:
#    servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
#  }
#
# === Authors
#
# Author Name <author@domain.com>
#
# === Copyright
#
# Copyright 2013 Your name here, unless otherwise noted.
#
class lustre {
  $lustre_release=regsubst($kernel_version,'-','_')
  case $operatingsystemmajrelease {
   '5': {
         if $login_node {
             package { 'lustre-config':
                  provider => 'rpm',
                  ensure   => 'installed',
                  source   => 'http://202.122.33.67/quattor/lustre/lustre-config-1.0-18.UI.64bit.i386.rpm',
                  require  => Package['lustre'],
             }
         }
         else {
             package { 'lustre-config':
                  provider => 'rpm',
                  ensure   => 'installed',
                  source   => 'http://202.122.33.67/quattor/lustre/lustre-config-1.0-24.64bit.i386.rpm',
                  require  => Package['lustre'],
             }
         }

	 package { 'lustre':
	      provider => 'rpm',
	      ensure => 'installed',
	      source => 'http://202.122.33.67/quattor/lustre/lustre-1.8.8-wc1_2.6.18_348.3.1.el5.x86_64.rpm',
	      require => Package['lustre-modules'],
	 }

	 package { 'lustre-modules':
	      provider => 'rpm',
	      ensure => 'installed',
	      source => 'http://202.122.33.67/quattor/lustre/lustre-modules-1.8.8-wc1_2.6.18_348.3.1.el5.x86_64.rpm',
	 }
	 package { 'lustre-tests':
	      provider => 'rpm',
	      ensure => 'installed',
	      source => 'http://202.122.33.67/quattor/lustre/lustre-tests-1.8.8-wc1_2.6.18_348.3.1.el5.x86_64.rpm',
	      require => Package['lustre'],
	 } 
    }

    '6': {
         if $login_node {
             package { 'lustre-config':
                  provider => 'rpm',
                  ensure   => 'installed',
                  source   => 'http://202.122.33.67/quattor/lustre/lustre-config-1.0-18.UI.64bit.i386.rpm',
                  require  => Package['lustre'],
             }
         }
         else {
             package { 'lustre-config':
                  provider => 'rpm',
                  ensure   => 'installed',
                  source   => 'http://202.122.33.67/quattor/lustre/lustre-config-1.0-24.64bit.i386.rpm',
                  require  => Package['lustre'],
             }
         }
         package { 'lustre':
              provider => 'rpm',
              ensure   => "${lustre_version}${lustre_release}.x86_64",
              source   => "http://202.122.33.67/quattor/lustre/lustre-${lustre_version}${lustre_release}.x86_64.x86_64.rpm",
              require  => Package['lustre-modules'],
         }

         package { 'lustre-modules':
              provider => 'rpm',
              ensure   => "${lustre_version}${lustre_release}.x86_64",
              source   => "http://202.122.33.67/quattor/lustre/lustre-modules-${lustre_version}${lustre_release}.x86_64.x86_64.rpm",
         }
         package { 'lustre-tests':
              provider => 'rpm',
              ensure   => "${lustre_version}${lustre_release}.x86_64",
              source   => "http://202.122.33.67/quattor/lustre/lustre-tests-${lustre_version}${lustre_release}.x86_64.x86_64.rpm",
              require  => Package['lustre'],
         }

    }
  }
}
